//------------------------------------------------------------------------------
#include <QFile>
#include <QTextStream>
#include <QTextCodec>
#include <QtGui>
#include "CTextAfficheFrm.h"
//------------------------------------------------------------------------------
CTextAfficheFrm::CTextAfficheFrm(QWidget *parent, QString fileName) : QDialog(parent)
{
	QFile *file;
	QTextStream *textStream;
	QString text="";
	
	setupUi(this);
	
	file=new QFile(fileName);
	if(file->open(QIODevice::ReadOnly | QIODevice::Text))
	{
		textStream=new QTextStream(file);
		textStream->setCodec(QTextCodec::codecForName("utf8"));
		while (!textStream->atEnd())
		{
			QString line = textStream->readLine();
			text+=line;
		}
		
		delete textStream;
		delete file;
	}
	
	textEdit->setHtml(text);
}
//------------------------------------------------------------------------------